home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #1 / Amiga Plus 1995 #1.iso / fish-disketten / fish_941-950 / d945 / iffconvert / iffpack.doc < prev    next >
Text File  |  1994-12-13  |  6KB  |  181 lines

  1. TABLE OF CONTENTS
  2.  
  3. IFFCleanup
  4. ReadBody
  5. ReadPicSize
  6. SetColors
  7. WriteWindow
  8. New compression format
  9.  
  10. IFFCleanup                                                        IFFCleanup
  11.  
  12.    NAME
  13.         IFFCleanup -- Clean up all allocated memory
  14.  
  15.    SYNOPSIS
  16.         void IFFCleanup(void);
  17.  
  18.    FUNCTION
  19.         Frees all memory that was allocated by ReadBody, ReadPicSize or
  20.         WriteWindow
  21.  
  22.  
  23. ReadBody                                                            ReadBody
  24.  
  25.    NAME
  26.         ReadBody -- Read the bitmap data (i.e. the BODY-Chunk)
  27.  
  28.    SYNOPSIS
  29.         error = ReadBody(rp,fp);
  30.  
  31.         int ReadBody(struct RastPort *,FILE *);
  32.  
  33.    FUNCTION
  34.         This fucntion reads the bitmap data, after the size of the picture
  35.         has been read with ReadPicSize.
  36.  
  37.    INPUTS
  38.         rp - pointer to the RastPort structure, where the picture will be
  39.              loaded to
  40.         fp - standard C filepointer
  41.  
  42.  
  43.    RESULT
  44.         errorcode:  NO_ERROR            0
  45.                     NO_MEMORY           1
  46.                     BAD_IFF             2
  47.                     READ_ERROR          3
  48.                     UNKNOWN_COMPRESSION 5
  49.  
  50.    SEE ALSO
  51.          ReadPicSize(),SetColors()
  52.  
  53. ReadPicSize                                                      ReadPicSize
  54.  
  55.    NAME
  56.         ReadPicSize -- Read the size of the picture
  57.  
  58.    SYNOPSIS
  59.         error = ReadPicSize(fp,win_width,win_height,
  60.                                scr_width,scr_height,depth,viewmode);
  61.  
  62.         int ReadPicSize(FILE *,SHORT *,SHORT *,
  63.                                SHORT *,SHORT *,SHORT *,USHORT *);
  64.  
  65.    FUNCTION
  66.         This fucntion reads the size of the picture and stores the values
  67.         in the variables the pointers point to. Furthermore it reads the
  68.         colortable of the picture.
  69.  
  70.    INPUTS
  71.         fp                   - standard C filepointer
  72.         win_width,win_height - pointers to the variables for width and height
  73.                                of the window
  74.         scr_width,scr_height - pointers to the variables for width and height
  75.                                of the screen
  76.         depth                - pointer to the variable for the depth of the
  77.                                screen
  78.         viewmode             - pointer to the variable for the viewmode
  79.                                (<-> CAMG-Chunk)
  80.  
  81.  
  82.    RESULT
  83.         errorcode:  NO_ERROR            0
  84.                     NO_MEMORY           1
  85.                     BAD_IFF             2
  86.                     READ_ERROR          3
  87.                     UNKNOWN_COMPRESSION 5
  88.  
  89.    SEE ALSO
  90.          ReadBody(),SetColors()
  91.  
  92. SetColors                                                          SetColors
  93.  
  94.    NAME
  95.         SetColors -- Set the colors, that has been read by ReadPicSize
  96.  
  97.    SYNOPSIS
  98.         SetColors(vp);
  99.  
  100.         void SetColors(struct ViewPort *);
  101.  
  102.    FUNCTION
  103.         This fucntion sets the colors, that has been read by ReadPicSize()
  104.         in the specified ViewPort.
  105.  
  106.    INPUTS
  107.         vp - pointer to the ViewPort structure of the screen, where the
  108.              colors will be set.
  109.  
  110.    SEE ALSO
  111.          ReadPicSize(),ReadBody()
  112.  
  113. WriteWindow                                                      WriteWindow
  114.  
  115.    NAME
  116.         WriteWindow -- Write the contents of a window as an ILBM-Picture
  117.  
  118.    SYNOPSIS
  119.         error = WriteWindow(fp,window,mode,read_colors);
  120.  
  121.         int WriteWindow(FILE *,struct Window *,int,int);
  122.  
  123.    FUNCTION
  124.         This functions writes the contents of a window as an ILBM-Picture.
  125.         It supports three different compression modes:
  126.  
  127.            mode:
  128.  
  129.               0  - no compression
  130.               1  - normal horizontal byte compare run compression
  131.               2  - new vertical byte compare run compression
  132.  
  133.    INPUTS
  134.         fp          - standard C filepointer
  135.         window      - pointer to the Window structure of the Window that has
  136.                       to be written as an ILBM-Picture
  137.         mode        - compression mode
  138.         read_colors - specifies if the colors that have been read by the
  139.                       last ReadPicSize will be used for saving.
  140.  
  141.                       FALSE: Read the colors from the colortable of the
  142.                              screen
  143.                       TRUE:  use the old color-values
  144.  
  145.                       This enables to keep the full 24-bit palette when
  146.                       modifying pictures on non-AGA machines.
  147.  
  148.    RESULT
  149.         errorcode:  NO_ERROR            0
  150.                     NO_MEMORY           1
  151.                     BAD_IFF             2
  152.                     WRITE_ERROR         4
  153.                     UNKNOWN_COMPRESSION 5
  154.  
  155.    SEE ALSO
  156.         ReadPicSize(), New compression format
  157.  
  158. New compression format                                New compression format
  159.  
  160.    The new compression method does not compress row by row but column by
  161.    column. Each column has a width of 1 byte (8 pixel). First the 1st
  162.    column of the 1st bitplane is compressed, then the 1st column of the
  163.    2nd bitplane and so on.
  164.    The new compression format is marked with 2 in the compression field
  165.    of BMHD. The new format is very similar to the old compression format.
  166.    It is as follows:
  167.       The first byte v is a control byte. The values have the following
  168.       meaning:
  169.          v>=0:   v+1 uncompressed bytes are following
  170.          v<0:    the next byte is repeated -v+1 times
  171.          v=-128: The next unsigned (!) byte is the number of bytes that
  172.                  has to be copied from the column left of this column of
  173.                  the same bitplane.
  174.  
  175.       NOTE: never compress across the borders of the columns, like it was
  176.             not allowed in the old format to compress across the rows.
  177.  
  178.  
  179.  
  180.  
  181.